package com.guo.cmn.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @author gfj
 * @Date 2022/1/19 19:03
 */
@Configuration
public class CorsConfig extends WebMvcConfigurationSupport {
	@Override
	protected void addCorsMappings(CorsRegistry registry) {
		registry.addMapping("/**")
				.allowedOrigins("*")
				.allowCredentials(true)
				.allowedMethods("GET","POST","DELETE","PUT")
				.maxAge(3600);

	}
}
